//
//  DailyChartViewController.m
//  Stock
//
//  Created by blacksun on 11-6-21.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "DailyChartViewController.h"


@implementation DailyChartViewController

- (void)dealloc
{
    [super dealloc];
}



#pragma mark - OverWrite Parent
/*
-(void)chartViewDidDisplay{
    if (isDownLoading) {
        return;
    }
    [super chartViewDidDisplay];
    for (MyStock *remoteSotck in panrentController.parentController.remoteStocks) {
        if ([remoteSotck.uuid isEqualToString:panrentController.myStock.uuid]) {
            //remoteTimeStamp = remoteSotck.dailyChartTime;
            break;
        }
    }
    if (!self.imageView.image || panrentController.myStock.dailyChartTime < remoteTimeStamp) {
        [self.imageDownloader downLoadImageWithUrl:[NSString stringWithFormat:@"%@?id=%@&type=%@",kImageRequestUrl,panrentController.myStock.uuid,chartType]];
        isDownLoading = YES;
    }
    
}*/

-(void)requestFinishedWithResult:(id)aResult andUserinfo:(NSDictionary *)aUserinfo{
    [super requestFinishedWithResult:aResult andUserinfo:aUserinfo];
    self.imageView.image = aResult;
    isDownLoading = NO;
    currentMyStock.dc = remoteTimeStamp;
}
-(void)requestFinishedwithError:(NSError *)aError andUserinfo:(NSDictionary *)aUserinfo{
    isDownLoading = NO;
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    self.chartType = @"dc";
    MyStock *remoteStock = [[StockContext shareInstance] findRemoteStockWithStockId:currentMyStock.uuid];
    self.remoteTimeStamp = remoteStock.dc;
    [super viewDidLoad];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
 }

@end
